var Tag = React.createClass({
    getDefaultProps:function(){
        return {
            id:"",
            value:"",
            text:"",
            className:""
        }
    },
	handle: function(e){
		var _this = e.target || e.srcElement;
		this.props.onclose&&this.props.onclose();
		_this.parentNode.parentNode.parentNode.removeChild(_this.parentNode.parentNode);
		e.stopPropagation?e.stopPropagation():(e.cancelBubble = true);
	},
	render: function() {
		var displayVal = "none";
		this.props.close?(displayVal="inline-block"):'';
		return (
			<div id={this.props.id} className="ucs-tag" onClick={this.props.onClick}>
				<span>{this.props.value}
					<i style={"display:"+displayVal} onClick={this.handle.bind(this)}>×</i>
				</span>
			</div>)
	}
})
module.exports = Tag;



/*var Tag = React.createClass({
	config:{
        id:""
    },
	handle: function(e){
		var _this = e.target || e.srcElement;
		this.props.onclose&&this.props.onclose();
		//_this.parentNode.parentNode.style.display="none";
		//_this.parentNode.parentNode.parentNode.removeChild( _this );
		_this.parentNode.parentNode.parentNode.removeChild(_this.parentNode.parentNode);
		e.stopPropagation?e.stopPropagation():(e.cancelBubble = true);
	},
	render: function() {
		for(var key in this.props){
            this.config[key] = this.props[key];
        }
		var displayVal = "none";
		this.props.close?(displayVal="inline-block"):'';
		return (
			<div id={this.props.id} className="ucs-tag" onclick={this.props.onclick}>
				<span>{this.props.value}
					<i style={"display:"+displayVal} onclick={this.handle.bind(this)}>×</i>
				</span>
			</div>)
	}
})
module.exports = Tag;*/
